package org.ws.lifebacklog.service;

import java.util.ArrayList;
import java.util.List;

import org.ws.lifebacklog.model.Task;
import org.ws.lifebacklog.util.Logger;

/**
 * @author exebichi
 * 
 */
public class BacklogService {

	/**
	 * 50 items
	 */
	private static final String[] dummySalons = new String[] { "Ingen preferance", "Sentrum", "Nordas", "Voss", "Ramm",
			"Arna", "Stord", "Os", "Os1", "Os2",

			"Sentrum0", "Sentrum", "Nordas", "Voss", "Ramm", "Arna", "Stord", "Os", "Os1", "Os2",

			"Sentrum01", "Sentrum", "Nordas", "Voss", "Ramm", "Arna", "Stord", "Os", "Os1", "Os2",

			"Sentrum02", "Sentrum", "Nordas", "Voss", "Ramm", "Arna", "Stord", "Os", "Os1", "Os2",

			"Sentrum03", "Sentrum", "Nordas", "Voss", "Ramm", "Arna", "Stord", "Os", "Os1", "Os2" };

	/**
	 * 15 items
	 */
	private static final String[] dummyNames = new String[] { "Ingen preferance",

	"Stine", "Evelyn", "Maria", "Mona", "Else", "Aase Helen", "Karoline",

	"Stine", "Evelyn", "Maria", "Mona", "Else", "Aase Helen", "Karoline" };

	private static BacklogService _INSTANCE;

	private BacklogService() {
		super();
	}

	public static BacklogService getInstance() {
		if (_INSTANCE == null) {
			_INSTANCE = new BacklogService();
		}
		return _INSTANCE;
	}

	public List<Task> getTasks() {
		final List<Task> salons = new ArrayList<Task>();
		for (int i = 0; i < 50; i++) {
			Task salon = new Task();
			salon.setId(i);
			salon.setTitle("TASK " + i + 1);
			salon.setEstimate(i);
			salons.add(salon);
		}
		try {
			Thread.sleep(500);
		} catch (InterruptedException e) {
			Logger.e(getClass(), e);
		}

		return salons;
	}

}
